<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 86158
  Date: 2022/2/26
  Time: 22:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>CoolMeeting会议管理系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/styles/common.css"/>
    <style type="text/css">
    </style>
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.js"></script>
</head>
<body>
<div class="page-header">
    <div class="header-banner">
        <img src="${pageContext.request.contextPath}/images/header.png" alt="CoolMeeting"/>
    </div>
    <div class="header-title">
        欢迎访问Cool-Meeting会议管理系统
    </div>
    <div class="header-quicklink">
        欢迎您，<strong>${sessionScope.currentuser.employeename}</strong>
        <a href="${pageContext.request.contextPath}/changepassword">[修改密码]</a>
    </div>
</div>
<div class="page-body">
    <div class="page-sidebar">
        <div class="sidebar-menugroup">
            <jsp:include page="leftMenu.jsp" flush="true"></jsp:include>
        </div>
    </div>
    <div class="page-content">
        <div class="content-nav">
            会议预定 > 搜索员工
        </div>
        <form action="${pageContext.request.contextPath}/admin/searchemployees" method="post">
            <fieldset>
                <legend>搜索会议</legend>
                <table class="formtable">
                    <tr>
                        <td>姓名：</td>
                        <td>
                            <input name="employeename" type="text" id="employeename" value="${employee.employeename}" maxlength="20"/>
                        </td>
                        <td>账号名：</td>
                        <td>
                            <input name="username" type="text" id="accountname" value="${employee.username}" maxlength="20"/>
                        </td>
                        <td>状态：</td>
                        <td>
                            <c:if test="${status==1}">
                                <input type="radio" id="status" name="status" value="1" checked="checked"/><label>已批准</label>
                                <input type="radio" id="status" name="status" value="0"/><label>待审批</label>
                                <input type="radio" id="status" name="status" value="2"/><label>已关闭</label>
                            </c:if>
                            <c:if test="${status==0}">
                                <input type="radio" id="status" name="status" value="1"/><label>已批准</label>
                                <input checked="checked" type="radio" id="status" name="status" value="0"/><label>待审批</label>
                                <input type="radio" id="status" name="status" value="2"/><label>已关闭</label>
                            </c:if>
                            <c:if test="${status==2}">
                                <input type="radio" id="status" name="status" value="1"/><label>已批准</label>
                                <input type="radio" id="status" name="status" value="0"/><label>待审批</label>
                                <input checked="checked" type="radio" id="status" name="status" value="2"/><label>已关闭</label>
                            </c:if>

                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" class="command">
                            <input type="submit" class="clickbutton" value="查询"/>
                            <input type="reset" class="clickbutton" value="重置"/>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
        <div>
            <h3 style="text-align:center;color:black">查询结果</h3>
            <div class="pager-header">
                <div class="header-info">
                    共<span class="info-number">${total}</span>条结果，
                    分成<span class="info-number">${pagenum}</span>页显示，
                    当前第<span class="info-number">${page}</span>页
                </div>
                <div class="header-nav">
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/admin/searchemployees?employeename=${employee.employeename}&username=${employee.username}&status=${status}&page=1'" value="首页"/>
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/admin/searchemployees?employeename=${employee.employeename}&username=${employee.username}&status=${status}&page=${page-1}'"value="上页"/>
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/admin/searchemployees?employeename=${employee.employeename}&username=${employee.username}&status=${status}&page=${page+1}'"value="下页"/>
                    <input type="button" class="clickbutton" onclick="window.location='${pageContext.request.contextPath}/admin/searchemployees?employeename=${employee.employeename}&username=${employee.username}&status=${status}&page=${pagenum}'"value="末页"/>
                    <form action="${pageContext.request.contextPath}/admin/searchemployees" style="display: inline" method="get">
                        跳到第<input name="page" type="text" id="pagenum" class="nav-number"/>页
                        <input type="hidden" name="employeename" value="${employee.employeename}">
                        <input type="hidden" name="username" value="${employee.username}">
                        <input type="hidden" name="status" value="${status}">
                        <input type="submit" class="clickbutton" value="跳转"/>
                    </form>

                </div>
            </div>
        </div>
        <table class="listtable">
            <tr class="listheader">
                <th>姓名</th>
                <th>账号名</th>
                <th>联系电话</th>
                <th>电子邮件</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${emps}" var="emp">
                <tr>
                    <td>${emp.employeename}</td>
                    <td>${emp.username}</td>
                    <td>${emp.phone}</td>
                    <td>${emp.email}</td>
                    <td>
                        <a class="clickbutton" href="/admin/updateEmp/${emp.employeeid}">关闭账号</a>
                    </td>
                </tr>
            </c:forEach>

        </table>
    </div>
</div>
<div class="page-footer">
    <hr/>
    更多问题，欢迎联系<a href="mailto:webmaster@eeg.com">管理员</a>
    <img src="${pageContext.request.contextPath}/images/footer.png" alt="CoolMeeting"/>
</div>
</body>
</html>
